home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / pupworld.swf / scripts / __Packages / Heroes / BodyBox.as < prev    next >
Encoding:
Text File  |  2011-06-09  |  1.4 KB  |  42 lines

  1. class Heroes.BodyBox extends Heroes.AnyBox
  2. {
  3.    var myBox;
  4.    function BodyBox()
  5.    {
  6.       super();
  7.       if(this._parent._parent.facing == "right")
  8.       {
  9.          this.myBox = new Heroes.Box(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
  10.       }
  11.       else
  12.       {
  13.          this.myBox = new Heroes.Box(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
  14.       }
  15.    }
  16.    function onEnterFrame()
  17.    {
  18.       super.onEnterFrame();
  19.       if(this._parent._parent.facing == "right")
  20.       {
  21.          this.myBox.setLocation(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
  22.       }
  23.       else
  24.       {
  25.          this.myBox.setLocation(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
  26.       }
  27.       this.myBox.setSize(this._width,this._height,this._width);
  28.    }
  29.    function isHitting(attackBox)
  30.    {
  31.       return this.myBox.isHitting(attackBox);
  32.    }
  33.    function isTouching(px, py, pz)
  34.    {
  35.       return this.myBox.isTouching(px,py,pz);
  36.    }
  37.    function toString()
  38.    {
  39.       return this.myBox.toString();
  40.    }
  41. }
  42.